﻿using System;
using System.Collections.Generic;
using System.Text;
using YouHP.Utility;
using YouHP.BLL;

namespace YouHP.Pages
{
    public class Contact : BasePage
    {
        protected override void ShowPage()
        {
            base.ShowPage();
            this.SetTitle("联系我们");
            //this.AddLocation("用户注册", "/User/Register.aspx");
            this.AddLocation("联系我们", "/support/Alpha/Contact.aspx");
            //this.AddLinkCss("/support/Alpha/css/reg.css");

            if (RequestTools.IsPost())
            {
                HandlePost();
            }
        }
        
        protected void HandlePost()
        {
            string mailType = RequestTools.GetString("FeedBackType");
            string mailAddress = RequestTools.GetString("mailAddress");
            string mailContent = RequestTools.GetString("messageContent");

            bool successed = UserBLL.Instance.SendFeedbackMail(mailType, mailContent, mailAddress);
            if (successed)
            {
                AddMsgLine("发送留言成功");
                SetUrl("/Contact.aspx");
                SetMetaRefresh();
            }
        }        
    }
}
